# 读取数据并写入studs.txt
with open("data.txt", "r") as f_read, \
     open("studs.txt", "w", encoding="utf-8") as f_write:
    for line in f_read:
        line = line.strip()  # 去除换行符和空格
        if not line:
            continue
        name, s2 = line.split(":")  # 假设格式为“姓名 系名 分数”
        #分割成  李涵剑  和   经济191,430
        _,score=s2.split(",")
        # 经济191,430 分割成    经济191  和 430
        f_write.write(f"{name}:{score}\n")